package com.ruoyi.project.system.wxnotice.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.wxnotice.mapper.WxNoticeMapper;
import com.ruoyi.project.system.wxnotice.domain.WxNotice;
import com.ruoyi.project.system.wxnotice.service.IWxNoticeService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 通知Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-05-24
 */
@Service
public class WxNoticeServiceImpl implements IWxNoticeService 
{
    @Autowired
    private WxNoticeMapper wxNoticeMapper;

    /**
     * 查询通知
     * 
     * @param id 通知ID
     * @return 通知
     */
    @Override
    public WxNotice selectWxNoticeById(Long id)
    {
        return wxNoticeMapper.selectWxNoticeById(id);
    }

    /**
     * 查询通知列表
     * 
     * @param wxNotice 通知
     * @return 通知
     */
    @Override
    public List<WxNotice> selectWxNoticeList(WxNotice wxNotice)
    {
        return wxNoticeMapper.selectWxNoticeList(wxNotice);
    }

    /**
     * 新增通知
     * 
     * @param wxNotice 通知
     * @return 结果
     */
    @Override
    public int insertWxNotice(WxNotice wxNotice)
    {
        wxNotice.setCreateTime(DateUtils.getNowDate());
        return wxNoticeMapper.insertWxNotice(wxNotice);
    }

    /**
     * 修改通知
     * 
     * @param wxNotice 通知
     * @return 结果
     */
    @Override
    public int updateWxNotice(WxNotice wxNotice)
    {
        wxNotice.setUpdateTime(DateUtils.getNowDate());
        return wxNoticeMapper.updateWxNotice(wxNotice);
    }

    /**
     * 删除通知对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteWxNoticeByIds(String ids)
    {
        return wxNoticeMapper.deleteWxNoticeByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除通知信息
     * 
     * @param id 通知ID
     * @return 结果
     */
    @Override
    public int deleteWxNoticeById(Long id)
    {
        return wxNoticeMapper.deleteWxNoticeById(id);
    }
}
